<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>系统参数管理</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
</head>
<style>
</style>
<script>
    var sysParamBizList = '${sysParamBizList}';
    var sysParamBizModuleList = '${sysParamBizModuleList}';
    var dataTypeMap = '${dataTypeMap}';
    var statusMap = '${statusMap}';
</script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-search"></i> 筛选查询</h5>
                </div>
                <div class="ibox-content ibox-content-search">
                    <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">查询参数：</label>
                            <div class="col-sm-5">
                                <div class="input-group">
                                    <input type="text" name="paramName" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="paramName" class="form-control"  placeholder="输入参数名称" maxlength="20">
                                </div>
                            </div>
                            <div class="ibox-tools ibox-tools-search">
                                <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-table"></i> 参数信息</h5>
                    <div class="ibox-tools col-sm-offset-2">
                        <c:if test="${userType == 'super' || not empty btnMap['addParam']}">
                            <button class="btn btn-primary btn-outline" onclick="openAddSysParamPage()">新增</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['editParam']}">
                            <button class="btn btn-primary btn-outline" onclick="openEditSysParamPage()">编辑</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['stateParam']}">
                            <button class="btn btn-primary btn-outline change_text" onclick="changeState()">冻结</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['delParam']}">
                            <button class="btn btn-primary btn-outline" onclick="deleteSysParam()">删除</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['syncRedis']}">
                            <button class="btn btn-primary btn-outline" onclick="doSyncRedis()">同步redis</button>
                        </c:if>
                        <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class='table table-striped table-hover'
                           id="dataTable"  data-height="400"
                           data-toggle="table"
                           data-url="${ctx}/sysParam/pageFindSysParamData?t=${now}"
                           data-pagination="true"
                           data-side-pagination="server"
                           data-striped="true"
                           data-response-handler="handleServerResult"
                           data-query-params-type=""
                           data-query-params="getParams"
                           data-page-size="${defaultPageSize}"
                           data-page-list="${pageList}">
                        <thead>
                        <tr>
                            <th data-field="id" data-visible="false">参数ID</th>
                            <th data-field="status" data-align="center" data-width="80px" data-formatter="formatterStatus">状态</th>
                            <th data-field="paramCode" data-align="center" data-width="180px">参数编码</th>
                            <th data-field="paramName" data-align="center" data-width="180px">参数名称</th>
                            <th data-field="sysType" data-align="center" data-width="150px" data-formatter="formatterSysType">作用业务</th>
                            <th data-field="bizModule" data-align="center" data-width="150px" data-formatter="formatterBizModule">作用模块</th>
                            <th data-field="dataType" data-align="center" data-width="100px" data-formatter="formatterDataType">参数类型</th>
                            <th data-field="paramValue" data-align="center" data-width="180px">设定值</th>
                            <th data-field="defaultValue" data-align="center" data-width="180px">默认值</th>
                            <th data-field="remark" data-align="center" data-width="180px">描述</th>
                            <th data-field="creator" data-formatter="formatterCreator" data-align="center" data-width="100px">创建人</th>
                            <th data-field="operator" data-formatter="formatterOperator" data-align="center" data-width="100px">编辑人</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="text-center">${companyName}</div>
        </div>
    </div>
</div>

<div id="editSysParamPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle" style="text-align: center; font-weight: normal;">新增参数</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t" id="paramDataForm">
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>参数编码：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalParamCode" name="paramCode" class="form-control" maxlength="20" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>参数名称：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalParamName" name="paramName" class="form-control" maxlength="20" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>作用业务：</label>
                        <div class="col-sm-9">
                            <select type="text" id="modalSysType" name="sysType" class="form-control" required>
                                <option value="">--请选择--</option>
                                <c:if test="${not empty sysParamBizList}">
                                    <c:forEach items="${sysParamBizList}" var="item">
                                        <option value="${item.dictCode}">${item.dictName}</option>
                                    </c:forEach>
                                </c:if>
                            </select>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>作用模块：</label>
                        <div class="col-sm-9">
                            <select type="text" id="modalBizModule" name="bizModule" class="form-control" required>
                                <option value="">--请选择--</option>
                                <c:if test="${not empty sysParamBizModuleList}">
                                    <c:forEach items="${sysParamBizModuleList}" var="item">
                                        <option value="${item.dictCode}">${item.dictName}</option>
                                    </c:forEach>
                                </c:if>
                            </select>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>参数类型：</label>
                        <div class="col-sm-9">
                            <select type="text" id="modalDataType" name="dataType" class="form-control" onchange="doDataTypeChange()" required>
                                <option value="">--请选择--</option>
                                <c:forEach items="${dataTypeMap}" var="item">
                                    <option value="${item.key}" >${item.value}</option>
                                </c:forEach>
                            </select>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalParamValueFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>设定值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalParamValue" name="paramValue" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalDefaultValueFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>默认值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalDefaultValue" name="defaultValue" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalParamValue_dateTimeFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>设定值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalParamValue_dateTime" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalDefaultValue_dateTimeFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>默认值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalDefaultValue_dateTime" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalParamValue_dateFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>设定值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalParamValue_date" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new" id="modalDefaultValue_dateFromGroup">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>默认值：</label>
                        <div class="col-sm-9">
                            <input type="text" id="modalDefaultValue_date" class="form-control" maxlength="1024" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label">描述：</label>
                        <div class="col-sm-9">
                            <textarea type="text" id="remark" name="remark" class="form-control" maxlength="128" style="height: 60px; resize: none;"></textarea>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doSaveSysParam()">保存</button>
                <button class="btn btn-white" onclick="closeEditSysParamPage();">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/sys/dict/sysParamMgr.js?t=${now}"></script>
<script src="${ctx}/js/common/myDateTimeFormat.js?t=${now}"></script>
<script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?v=20180427"></script>
</body>
</html>


